package com.skillworld.webapp.web.util;

import java.util.Comparator;
import java.util.Locale;

import com.skillworld.webapp.model.department.Department;

public class DepartmentDisplayComparator implements Comparator<Department> 
{
    private Locale displayLocale;
    
    
    public DepartmentDisplayComparator(Locale displayLocale) 
    {
        this.displayLocale = displayLocale;
    }


    public int compare(Department d1, Department d2) 
    {
        String l1DisplayName = d1.getName(displayLocale);
        String l2DisplayName = d2.getName(displayLocale);
        return l1DisplayName.compareTo(l2DisplayName);
    }

}